﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class ToHop
    {
        int K;

        public int NhapK
        {
            get { return K; }
            set { K = value; }
        }
        int N;

        public int NhapN
        {
            get { return N; }
            set { N = value; }
        }
        public ToHop(int A, int B)
        {
            K = A;
            N = B;
        }

        public int giaithua(int B)
        {
            int KQ = 1;
            for (int i = 1; i <= B; i++)
            {
                KQ = KQ * i;

            }
            return KQ;
        }
        public int TinhToHop1()
        {
            int K1 = K - 1;
            int N1 = N - 1;
            int KQ;
            KQ= giaithua(N1)/(giaithua(K1)*giaithua(N1-K1));
            return KQ;
        }
        public int TinhToHop2()
        {
            
            int N1 = N - 1;
            int KQ = 1;
            KQ = giaithua(N1) / (giaithua(K) * giaithua(N1 - K));
            return KQ;
        }
        public int Pascal()
        {
            int KQ;
            KQ = TinhToHop1() + TinhToHop2();
            return KQ;
        }
    }
}
